module.exports = {
    // 单位转换
    style: {
        postcss: {
            mode: "extends",
            loaderOptions: {
                postcssOptions: {
                    ident: "postcss",
                    plugins: [
                        [
                            "postcss-px-to-viewport-8-plugin",
                            {
                                unitToConvert: "px",   // 要转换的单位
                                viewportWidth: 375,    // 设计稿宽度
                                unitPrecision: 5,      // 保留小数点后几位
                                propList: ["*"],
                                viewportUnit: "vw",
                                fontViewportUnit: "vw",
                                selectorBlackList: ["body"],  // 不需要转换的标签写入，比如body标签里的不希望转换的话
                                minPixelValue: 1,
                                mediaQuery: false,
                                replace: true,
                                exclude: /node_modules/,
                            },
                        ],
                    ],
                },
            },
        },
    },
    //antd样式兼容化
    babel: {
        "presets": [
            [
                "@babel/preset-env",
                {
                    "targets": {
                        "chrome": "49",
                        "ios": "10"
                    }
                }
            ]
        ],
        plugins: [
            ["@babel/plugin-proposal-private-methods", {"loose": true}]
        ]
    }
};